# 定义命名空间
namespace java Services.RocketMqProducer
namespace php Services.RocketMqProducer

struct Result {
	1: i32 code
	2: string msg
	3: optional string result
}

# 普通消息
struct CommonMessage {
    1: string topic;			                    
    2: string tags;
    3: string msg;
    4: optional string key;
}

# 延时消息
struct DelayMessage {
    1: string topic;			                    
    2: string tags;
    3: string msg;
    4: i64 seconds;
    5: optional string key;
}

# 顺序消息
struct OrderMessage {
    1: string topic;			                    
    2: string tags;
    3: string msg;
    4: string key;
    5: optional string shardingKey;
}

# 定义服务
service RocketMqProducer {

  	// 发送普通消息
    Result sendMsg(1: CommonMessage message)

    // 发送延时消息
    Result sendDelayMsg(1: DelayMessage delayMessage)

    // 发送顺序消息
    Result sendOrderMsg(1: OrderMessage orderMessage)
    
}